These arch-neutral hooks allow architectures to report hardware counters.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
#include <xen/mm.h>
#include <xen/guest_access.h>
#include <public/dom0_ops.h>
+#include <asm/perfc.h>
#undef PERFCOUNTER
#undef PERFCOUNTER_CPU
printk("\n");
}
-#ifdef PERF_ARRAYS
- ptwr_eip_stat_print();
-#endif
+ arch_perfc_printall();
}
void perfc_reset(unsigned char key)
}
}
-#ifdef PERF_ARRAYS
- ptwr_eip_stat_reset();
-#endif
+ arch_perfc_reset ();
}
static dom0_perfc_desc_t perfc_d[NR_PERFCTRS];
if (perfc_vals == NULL)
return -ENOMEM;
+ /* Architecture may fill counters from hardware. */
+ arch_perfc_gather();
+
/* We gather the counts together every time. */
for ( i = 0; i < NR_PERFCTRS; i++ )
{
--- /dev/null
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+
+static inline void arch_perfc_printall (void)
+{
+}
+
+static inline void arch_perfc_reset (void)
+{
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif
--- /dev/null
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+
+static inline void arch_perfc_printall (void)
+{
+}
+
+static inline void arch_perfc_reset (void)
+{
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif
--- /dev/null
+#ifndef __ASM_PERFC_H__
+#define __ASM_PERFC_H__
+#include <asm/mm.h>
+
+static inline void arch_perfc_printall (void)
+{
+#ifdef PERF_ARRAYS
+ ptwr_eip_stat_print();
+#endif
+}
+
+static inline void arch_perfc_reset (void)
+{
+#ifdef PERF_ARRAYS
+ ptwr_eip_stat_reset();
+#endif
+}
+
+static inline void arch_perfc_gather (void)
+{
+}
+
+#endif